package com.gongzhiyun.springboot3test.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gongzhiyun.springboot3test.entity.user.TbUserExinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TbUserExinfoMapper extends BaseMapper<TbUserExinfo> {
    //每发布一个帖子增加一个message数
    @Update("update tb_user_exinfo set messages=messages+1 where uid=#{uid}")
    int addMessages(Integer uid);

    //每删除一个帖子减少一个message数
    @Update("update tb_user_exinfo set messages=messages-1 where uid=#{uid}")
    int DecMessages(Integer uid);

    //关注用户增加，减少followMines,mineFollows
    @Update("update tb_user_exinfo set follow_mines=follow_mines+1 where uid=#{uid}")
    int addfollowMines(Integer uid);

    @Update("update tb_user_exinfo set follow_mines=follow_mines-1 where uid=#{uid}")
    int DecfollowMines(Integer uid);

    @Update("update tb_user_exinfo set mine_follows=mine_follows+1 where uid=#{uid}")
    int addmineFollows(Integer uid);

    @Update("update tb_user_exinfo set mine_follows=mine_follows-1 where uid=#{uid}")
    int DecmineFollows(Integer uid);

    @Update("update  tb_user_exinfo set logo=#{logo} where uid=#{uid}")
    int updateLogo(String logo ,Integer uid);
}
